package com.htu.study.controller.user;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.htu.study.mapper.UserMapper;
import com.htu.study.pojo.User;
import com.htu.study.service.user.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/htu/user/account/token/")
    public Map<String, String> GetToken(@RequestParam Map<String, String> map) {
        String user_name = map.get("user_name");
        String user_password = map.get("user_password");
        return loginService.getToken(user_name, user_password);
    }
}
